

<template>
<div class="bigbox">
    <el-form ref="form" :model="tableData" label-width="80px">
        <el-form-item label="积分抵用">
          <el-input v-model="tableData.pointsCredit"/>
        </el-form-item>

      <el-form-item label="下单赠送积分">
        <el-input v-model="tableData.sendPoints"/>
      </el-form-item>

      <el-form-item label="积分抵扣上限">
        <el-input v-model="tableData.upper"/>
      </el-form-item>

      <el-form-item label="积分冻结(天)">
        <el-input v-model="tableData.blocking"/>
      </el-form-item>
    </el-form>

  <div slot="footer" class="dialog-footer">
    <el-button type="primary" @click="submit">提 交</el-button>
  </div>
</div>
</template>
<script>
import {getSetting, updateSetting} from "@/api/points/setting";

export default {
  created() {
    this.findItem();
  },
  data() {
    return {
      id:1,
      tableData: {}
    }
  },
  methods: {
    findItem(){
      getSetting(this.id).then(response => {
        this.tableData=response.data;
      })
    },
    submit(){
      updateSetting(this.tableData).then(response => {
        this.$message({
          message: '修改成功',
          type: 'success'
        });
        this.findItem();
      })
    }
  }
}
</script>
<style scoped lang="scss">
.bigbox{
  margin-top: 80px;
  margin-left: 80px;
}
.el-input{
  width: 200px;
}
</style>
